package cn.wolfcode.luowowo.repository;

import cn.wolfcode.luowowo.domain.Travel;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TravelRepository extends MongoRepository<Travel, String> {

    //通过目的地id查阅读量前三的游记
    List<Travel> findByDestId(String destId, PageRequest of);

    /**
     * 通过目的地的名字查询游记
     * @param destName
     * @return
     */
    List<Travel> findByDestName(String destName);
}
